<?php
error_reporting(E_ALL);
$user = $_GET["id"];
$con = mysqli_connect("localhost","davidjwa_hack","hackathon16","davidjwa_hack");
// Check connection


if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }

$result = mysqli_query($con,"SELECT * FROM users WHERE id = '$user'");


$json = array();
while($r=mysqli_fetch_array($result)){
  $json[] = $r;
}
echo json_encode($json);




mysqli_close($con);
?>